<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-Hans">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
    <title></title>
    
    <script type ="text/javascript">
    
    /*
        : doTransform()
        : ָ XML/XSL ִ XSL 任, ʹý滻ָĿ.
        : Ŀǰ IE .
        ﷨: void doTransform(String sXmlUrl, String sXslUrl [,String sTarget])
        : sXmlUrl   [in] XML ļ·.
              sXslUrl   [in] XSL ļ·.
              sTarget   [in] Ҫ滻Ŀ. ʹ DOM ID ʾ.
        
        : 
        : 2006-02-20
        ԭ: йά - XML ̳    http://bbs.xml.org.cn
        Ȩ: ҵ-ͬʽ 1.0    http://creativecommons.org/licenses/nc-sa/1.0/
    */
    function doTransform(sXmlUrl, sXslUrl,sTarget)
    {
        var oXml, oXsl, iCount;
        
        try
        {
            oXml = new ActiveXObject("Microsoft.XMLDom");
            oXsl = new ActiveXObject("Microsoft.XMLDom");
        }
        catch(e)
        {
            alert("Բ, ִ֧ϵͳ.  bbs.xml.org.cn ԻȡϸϢ.");
        }
        
        iCount = 0;                
        
        oXml.load(sXmlUrl);
        oXsl.load(sXslUrl);
                
        //׼״̬ʱ...
        //ʵֹؼ: ʹ. 
        oXml.onreadystatechange = function()
        {
            if (oXml.readyState == 4)
            {
                iCount++;
                checkState();   //״̬
            }
        }
        
        oXsl.onreadystatechange = function()
        {
            if (oXsl.readyState == 4)
            {
                iCount++;
                checkState();
            }
        }
        
        //״̬
        function checkState()
        {
            if (iCount == 2)     //״̬ =^_^=
            {
                doOutput();
            }
        }
        
        //ִ
        function doOutput()
        {
            var sResult = oXml.transformNode(oXsl); //xsl 任
            
            if(sTarget != undefined)
            {
                document.getElementById(sTarget).innerHTML = sResult;   //dom 滻
            }
            else
            {
                alert(sResult); //sTarget Ϊʱ, 鿴.
            }
        }
    }
    
    function init() //ִҳʼ
    {
        doTransform("20062231014111567.xml", "200622310141632897.xsl", "less");
        doTransform("200622310142222136.xml", "200622310143593961.xsl", "more");
    }
        
    window.onload = init;   //ָҳʼ
    </script>
</head>

<body>
    <div id = "less">ݼ...</div>
    <div id = "more">ݼ...</div>
</body>
</html>